<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    /* 相对定位
    .relative {
        position: relative;
        left: 0;
        top: 0;
        height: 100px;
        width: 100px;
        background-color: pink;
    } */

    .father {
        position: relative;
        height: 400px;
        width: 400px;
        background-color: skyblue;
    }

    /* 绝对定位 */
    .son {
        position: absolute;
        height: 200px;
        width: 200px;
        display: inline-block;
        background-color: red;
    }
</style>

<body>
    <!-- <div class="relative"></div> -->
    <div class="father">
        <p class="son"></p>
    </div>
</body>

</html>